From: Colin Walters Date: Thu, 22 Jan 2015 02:16:11 +0000 (-0500) Subject: commit: Fix segfault on async writes if object exists and checksum requested X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~968 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=549f1ec7df58b9e9adcd25a0825f47fc71d2dd9e;p=ostree.git commit: Fix segfault on async writes if object exists and checksum requested If an object already existed and we somehow tried to pull it, the caller would still expect a returned checksum. This appears to happen with static deltas for some reason; we might be including duplicate metadata objects. Regardless, this is a bug that should be fixed. --- diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c index ca52704e..a149c2e0 100644 --- a/src/libostree/ostree-repo-commit.c +++ b/src/libostree/ostree-repo-commit.c @@ -478,6 +478,8 @@ write_object (OstreeRepo *self, goto out; if (have_obj) { + if (out_csum) + *out_csum = ostree_checksum_to_bytes (expected_checksum); ret = TRUE; goto out; }